package com.ruoyi.labdata.domain;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 机构对象 lab_orgnization
 *
 * @author winner pan
 * @date 2022-02-02
 */
public class LabOrgnization extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 编码 */
    private Long orgId;


    private Long parentId;
    
    private String orderNum;

    public String getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}

	/** 上级机构 */
    @Excel(name = "上级机构")
    private String parentName;

    public String getParentName() {
    	if(this.parentName==null){
    		return "无" ;
    	}
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	/** 机构名称 */
    @Excel(name = "机构名称")
    private String orgName;

    /** 机构代码 */
    @Excel(name = "机构代码")
    private String orgCode;

    /** 创建年份 */
    @Excel(name = "创建年份")
    private String createYear;

    /** 机构属性 */
    @Excel(name = "机构属性")
    private Long orgFunctionOpt;

    /** 存在下级 */
    @Excel(name = "存在下级")
    private Long hasChildOpt;

    /** 状态 */
    @Excel(name = "状态")
    private Long orgStatusOpt;

    /** 二维码 */
    @Excel(name = "二维码")
    private String qrCode;
    
    private String qrCodePath;
   
    public String getQrCodePath() {
		return qrCodePath;
	}

	public void setQrCodePath(String qrCodePath) {
		this.qrCodePath = qrCodePath;
	}

	/** 机构分组 */
    @Excel(name = "机构分组")
    private Long orgGroupOpt;

    private int childNum;

    /**
     * 已经选中的用户Id.
     */
    private String checkedOrgIds;

    // 流程实例id
    private Long instanceId;

    public Long getInstanceId() {
        return instanceId;
    }


    public void setInstanceId(Long instanceId) {
        this.instanceId = instanceId;
    }

    /** 子部门 */
    private List<LabOrgnization> children = new ArrayList<LabOrgnization>();

    public List<LabOrgnization> getChildren() {
        return children;
    }

    public void setChildren(List<LabOrgnization> children) {
        this.children = children;
    }

    public int getChildNum() {
		return childNum;
	}

	public void setChildNum(int childNum) {
		this.childNum = childNum;
	}

	public void setOrgId(Long orgId)
    {
        this.orgId = orgId;
    }

    public Long getOrgId()
    {
        return orgId;
    }
    public void setParentId(Long parentId)
    {
        this.parentId = parentId;
    }

    public Long getParentId()
    {
        return parentId;
    }
    public void setOrgName(String orgName)
    {
        this.orgName = orgName;
    }

    public String getOrgName()
    {
        return orgName;
    }
    public void setOrgCode(String orgCode)
    {
        this.orgCode = orgCode;
    }

    public String getOrgCode()
    {
        return orgCode;
    }
    public void setCreateYear(String createYear)
    {
        this.createYear = createYear;
    }

    public String getCreateYear()
    {
        return createYear;
    }
    public void setOrgFunctionOpt(Long orgFunctionOpt)
    {
        this.orgFunctionOpt = orgFunctionOpt;
    }

    public Long getOrgFunctionOpt()
    {
        return orgFunctionOpt;
    }
    public void setHasChildOpt(Long hasChildOpt)
    {
        this.hasChildOpt = hasChildOpt;
    }

    public Long getHasChildOpt()
    {
        return hasChildOpt;
    }
    public void setOrgStatusOpt(Long orgStatusOpt)
    {
        this.orgStatusOpt = orgStatusOpt;
    }

    public Long getOrgStatusOpt()
    {
        return orgStatusOpt;
    }
    public void setQrCode(String qrCode)
    {
        this.qrCode = qrCode;
    }

    public String getQrCode()
    {
        return qrCode;
    }
    public void setOrgGroupOpt(Long orgGroupOpt)
    {
        this.orgGroupOpt = orgGroupOpt;
    }

    public Long getOrgGroupOpt()
    {
        return orgGroupOpt;
    }

    public String[] getCheckedList(){
        if(this.checkedOrgIds==null){
            return null;
        }
        return this.checkedOrgIds.split(",");
    }

    public String getCheckedOrgIds() {
        return checkedOrgIds;
    }

    public void setCheckedOrgIds(String checkedOrgIds) {
        this.checkedOrgIds = checkedOrgIds;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("orgId", getOrgId())
            .append("parentId", getParentId())
            .append("orgName", getOrgName())
            .append("orgCode", getOrgCode())
            .append("createYear", getCreateYear())
            .append("orgFunctionOpt", getOrgFunctionOpt())
            .append("hasChildOpt", getHasChildOpt())
            .append("orgStatusOpt", getOrgStatusOpt())
            .append("qrCode", getQrCode())
            .append("orgGroupOpt", getOrgGroupOpt())
            .toString();
    }
}
